#ifndef INPUT_MANAGER_H
#define INPUT_MANAGER_H


//#include <encoding_manager.h>
#include <unistd.h>
//#include <config.h>
#include <sys/time.h>
#include <pthread.h>

#include <config.h>
#include <font_manager.h>
#include <disp_manager.h>
#include <encoding_manager.h>
#include <input_manager.h>

#define INPUT_TYPE_STDIN 			0
#define INPUT_TYPE_TOUCHSCREEN 	0

#define INPUT_VALUE_UP			0
#define INPUT_VALUE_DOWN		1
#define INPUT_VALUE_EXIT		2
#define INPUT_VALUE_UNKNOW 	-1

typedef enum
{
	KEYTYPE_UP = 0,
	KEYTYPE_SELECT,
	KEYTYPE_PREPAGE,
	KEYTYPE_NEXTPAGE,
}E_KEYTYPE;

typedef struct InputEvent
{
	int		iPosX;
	int		iPosY;
	unsigned int	uiPressure;
	E_KEYTYPE e_KeyType;
	struct timeval	tTv;

}*PT_InputEvent,T_InputEvent;

typedef struct InputOpr
{
	char *Name;
	int iFd;
	pthread_t iTid;
	int (*DeviceInit)(void);	
	int (*DeviceExit)(void);
	 int (*GetInputEv)(PT_InputEvent pt_InputEvent);
	struct InputOpr *pNext;
}T_InputOpr;

T_InputOpr* GetInputOpr(char *pcName);

int RegisterInputOpr(T_InputOpr *pInputOpr);
int TsInit(void);
int StdioInit(void);

#endif
